<?php
Class BaseModel
{
	var $Collection;
	var $Parameters;
	
	function BaseModel($id=-1)
	{
		$this->ID         = 0;
		$this->Collection = array();
		$this->Parameters = array();
	  
		  if ($id != -1)
		  {
	  		$this->ID = $id;
	  	}
	}
	
	function GetParameter($key, $multiValue=FALSE)
	{
		if (isset($this->Parameters[$key]))
		{
		    if ($multiValue)
		    {
		      return $this->Parameters[$key];
		    }
		    else
		    {
				if (is_array($this->Parameters[$key]))
				{
					if (count($this->Parameters[$key]) > 0)
					{
						return $this->Parameters[$key][0];
					}
				}
				else
				{
					return $this->Parameters[$key];
				}
		    }
		}
	  
	  return '';
	}

	function ParameterExists($key)
	{
		$exists = 0;
		
    $exists = isset($this->Parameters[$key]);

		return $exists;
	}
}
?>